package apiday08.reflect;

import java.util.Scanner;

public class ReflectDemo2 {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {

        String str = "apiday08.reflect.";
        System.out.println("请输入类名！");
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        Class cls = Class.forName(str+line);
        Object obj = cls.newInstance();
        System.out.println(obj);
    }
}
